import api from '@/plugins/request'

// 增加返现记录
export function addCashback(params) {
  return api.post(`${process.env.VITE_APP_HAIERTOOLS_API}api/v1/wallet/cashback/store`, params, {
    isDoEncrypt: true
  })
}

// 编辑返现记录
export function emitCashback(params, requestId) {
  return api.post(`${process.env.VITE_APP_HAIERTOOLS_API}api/v1/wallet/cashback/${requestId}/store`, params, {
    isDoEncrypt: true
  })
}

// 验证安装编号是否提交
export function validateIrn(params) {
  return api.post(`${process.env.VITE_APP_HAIERTOOLS_API}api/v1/wallet/cashback/validate/irn`, params, {
    isDoEncrypt: true
  })
}

// 返现记录list
export function getCashbackList(params) {
  return api.post(`${process.env.VITE_APP_HAIERTOOLS_API}api/v1/wallet/cashback/request/user`, params, {
  // return api.get(`${process.env.VITE_APP_HAIERTOOLS_API}api/v1/wallet/cashback/get-all`, params, {
    isDoEncrypt: true
  })
}

// 客服服务
export function getServicesContacts(params) {
  return api.post(`${process.env.VITE_APP_HAIERTOOLS_API}api/v1/services/contacts`, params, {
    isDoEncrypt: true
  })
}

// 免邮服务：新用户首单免邮，非首单899元起免邮
export function getFreeShipping(params) {
  return api.get(`/services/product/api/free/shipping/start`, params)
}